<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang='en'>
<head>
	<meta charset='utf-8' />
	<title>广溢信息技术有限公司</title>
	<meta content='' name='description' />
	<meta content='' name='author' />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- Bootstrap -->
	<link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet" >
    <link href="__PUBLIC__/css/jquery-ui-1.9.2.custom.css" rel="stylesheet" />
	<link href="__PUBLIC__/css/font-awesome.min.css" rel="stylesheet" >

	<!--[if IE 7]>
		<link  href="__PUBLIC__/css/font-awesome-ie7.min.css" rel="stylesheet">
	<![endif]-->

	<!--[if lt IE 9]>
		<link type="text/css" href="__PUBLIC__/css/custom-theme/jquery.ui.1.9.2.ie.css"  rel="stylesheet" />
	<![endif]-->

	<link href="__PUBLIC__/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="__PUBLIC__/css/test.css" rel="stylesheet">
	<script src="__PUBLIC__/js/jquery.js"></script>

	<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
	<!--[if lt IE 9]>
	<script src="__PUBLIC__/js/html5shiv.js"></script>
	<script src="__PUBLIC__/js/respond.min.js"></script>
	<![endif]-->
	<script type="text/javascript">
	var upload_url="<?php echo U('file/upload?module='.MODULE_NAME);?>";
	var del_url="<?php echo U('File/del');?>";
	var session_id="<?php echo session_id();?>";	
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?2a935166b0c9b73fef3c8bae58b95fe4";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
</script>
</head>
<body>
	<div class="shade"></div>
	<div class="row-fluid navbar visible-phone">
	<div class="row-fluid">
		<a class="brand" href="<?php echo U('home/index');?>">广溢网络</a>
		<a data-toggle="collapse" data-target="#top_menu" class="right">
		<i class="brand icon-th-list"></i>
		</a>
	</div>
	<div class="col-lapse" id="top_menu">
		<ul class="nav nav-pills">
			<?php if(is_array($list_top_menu)): $i = 0; $__LIST__ = $list_top_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tag): $mod = ($i % 6 );++$i;?><li>
					<a  href="#" url="<?php echo U($tag['url']);?>" node="<?php echo ($tag["id"]); ?>" onclick="click_top_menu(this)"><?php echo ($tag["name"]); ?></a>
				</li><?php endforeach; endif; else: echo "" ;endif; ?>
		</ul>
	</div>
</div>
<div class="row-fluid navbar hidden-phone">
	<a class="brand" href="<?php echo U('home/index');?>">广溢网络</a>
	<ul class="nav nav-pills">
		<?php if(is_array($list_top_menu)): $i = 0; $__LIST__ = $list_top_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tag): $mod = ($i % 6 );++$i;?><li>
				<a  href="#" url="<?php echo U($tag['url']);?>" node="<?php echo ($tag["id"]); ?>" onclick="click_top_menu(this)"><?php echo ($tag["name"]); ?></a>
			</li><?php endforeach; endif; else: echo "" ;endif; ?>
	</ul>
	<aside>
		<span>
			<a href="<?php echo U('UserConfig/index');?>">设置</a>
		</span>
		<span>
			<a href="<?php echo U('profile/index');?>"><?php echo (session('user_name')); ?></a>
		</span>
		<span>
			<a href="<?php echo U('login/logout');?>">退出</a>
		</span>
		&nbsp;&nbsp;
	</aside>
</div>

	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span3 left_menu">
				<div class="visible-phone">
	<h4 class="btn no-border" data-toggle="collapse" data-target="#left_menu">		
			<?php echo ($top_menu_name); ?><i class="icon-angle-down"></i>
		</h4>
	<div class="col-lapse" id="left_menu"><?php echo ($html_left_menu); ?></div>
</div>
<div class="hidden-phone">
	<h4><?php echo ($top_menu_name); ?></h4>
	<div><?php echo ($html_left_menu); ?></div>
</div>
			</div>
			<div class="span9 content">

<script type="text/javascript">
	var manager = null;
	function add() {
		pid = $("#id").val();
		$("#form_data :input :not(:button)").each(function() {
			$(this).val("");
		});
		$("#form_data :text").each(function() {
			$(this).val("");
		});
		$("#pid").val(pid);
		$("#opmode").val("add");
	};

	function save() {
		if(check_form("form_data")){
			sendForm("form_data", "<?php echo U('save');?>","__URL__");
		}
	}

	function test() {
		form_search.submit();
	};

	function select_pid() {
		winopen("<?php echo U('winpop');?>", 600, 400);
	}

	function showdata(result) {
		for (var s in result.data){
			set_val(s,result.data[s]);
		}
		$("#dept_name").val($("#dept_list option[value='" + $("#pid").val() + "']").text());
		$("#opmode").val("edit");
	}


	$(document).ready(function() {
		$(".sub_left_menu .tree_menu  a").click(function() {
			$(".sub_left_menu .tree_menu  a").each(function() {
				$(this).attr("class", "");
			});
			$(this).attr("class","active");
			sendAjax("<?php echo U('read');?>", "id=" + $(this).attr("node"), function(data) {
				showdata(data);
			});
			return false;
		})
	});

</script>
<div class="admin" >
	<div class="row-fluid title">
		<span>部门管理</span>
	</div>
	<div class="row-fluid operate" >
		<div class="right">
			<a onclick="add()" class="btn">新增</a>
			<a onclick="save()"  class="btn">保存</a>
		</div>
	</div>
	<!-- 功能操作区域结束 -->
	<!-- 列表显示区域  -->
	<div class="row-fluid">
		<div class="span4 sub_left_menu">
			<div class="wrap">
				<?php echo $menu ?></div>
		</div>
		<div class="span8 sub_content ">
			<form id="form_data" name="form_data" method="post" action="">
				<input type="hidden" name="id" id="id">				
				<input type="hidden" name="ajax" id="ajax" value="1">
				<input type="hidden" name="opmode" id="opmode" value="">
				<select type="select-one" id="dept_list" name="dept_list" onchange="" ondblclick="" class="dis" ><?php  foreach($dept_list as $key=>$val) { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } ?></select>
				<div class="row-fluid form_box">
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="dept_no">编码*：</label>
							<div class="controls">
								<input type="text" id="dept_no" name="dept_no" check="require" msg="请输入分类编码"></div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="name">名称*：</label>
							<div class="controls">
								<input type="text" id="name" name="name" check="require" msg="请输入名称"></div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="short">简称*：</label>
							<div class="controls">
								<input type="text" id="short" name="short" check="require" msg="请输入简称"></div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="dept_grade_id">部门级别：</label>
							<div class="controls">
								<select type="select-one" id="dept_grade_id" name="dept_grade_id" onchange="" ondblclick="" class="medium" ><option value="" >选择部门级别</option><?php  foreach($dept_grade_list as $key=>$val) { ?><option value="<?php echo $key ?>"><?php echo $val ?></option><?php } ?></select>
							</div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="dept_name">上级部门：</label>
							<div class="controls">
								<div class="input-append">
									<input name="dept_name" class="val" id="dept_name" type="text" msg="请选择上级部门" check="require" source="<?php echo U('dept/json');?>" />
									<input name="pid" class="key" id="pid" type="hidden" msg="请选择上级部门" check="require" />
									<button class="btn" onclick="select_pid()" type="button">选择</button>
								</div>
								<div class="search dropdown ">
									<ul class="dropdown-menu"></ul>
								</div>
							</div>							
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="sort">排序：</label>
							<div class="controls">
								<input type="text" id="sort" name="sort" readonly></div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="is_del">状态：</label>
							<div class="controls">
								<select   name="is_del" id="is_del">
									<option  value="0">启用</option>
									<option value="1">禁用</option>
								</select>
							</div>
						</div>
					</div>
					<div class="row-fluid form-horizontal">
						<div class="control-group">
							<label class="control-label" for="is_del">状态：</label>
							<div class="controls">
								<textarea id="remark" name="remark" class="span12"></textarea>
							</div>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div></div>
		</div>
	</div>
	<div class="msg popout"></div>
	<iframe src="<?php echo U('push/client');?>" class="push" id="push"></iframe>
	<script src="__PUBLIC__/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/js/jquery-ui-1.9.2.custom.min.js"></script>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>